use macroquad::prelude::*;

// binds between strings and macroquad KeyCodes
pub fn keycode(s: &str) -> KeyCode {
    match s {
        "space" => KeyCode::Space,
        "apostrophe" => KeyCode::Apostrophe,
        "comma" => KeyCode::Comma,
        "minus" => KeyCode::Minus,
        "period" => KeyCode::Period,
        "slash" => KeyCode::Slash,
        "key0" => KeyCode::Key0,
        "key1" => KeyCode::Key1,
        "key2" => KeyCode::Key2,
        "key3" => KeyCode::Key3,
        "key4" => KeyCode::Key4,
        "key5" => KeyCode::Key5,
        "key6" => KeyCode::Key6,
        "key7" => KeyCode::Key7,
        "key8" => KeyCode::Key8,
        "key9" => KeyCode::Key9,
        "semicolon" => KeyCode::Semicolon,
        "equal" => KeyCode::Equal,
        "a" => KeyCode::A,
        "b" => KeyCode::B,
        "c" => KeyCode::C,
        "d" => KeyCode::D,
        "e" => KeyCode::E,
        "f" => KeyCode::F,
        "g" => KeyCode::G,
        "h" => KeyCode::H,
        "i" => KeyCode::I,
        "j" => KeyCode::J,
        "k" => KeyCode::K,
        "l" => KeyCode::L,
        "m" => KeyCode::M,
        "n" => KeyCode::N,
        "o" => KeyCode::O,
        "p" => KeyCode::P,
        "q" => KeyCode::Q,
        "r" => KeyCode::R,
        "s" => KeyCode::S,
        "t" => KeyCode::T,
        "u" => KeyCode::U,
        "v" => KeyCode::V,
        "w" => KeyCode::W,
        "x" => KeyCode::X,
        "y" => KeyCode::Y,
        "z" => KeyCode::Z,
        "leftbracket" => KeyCode::LeftBracket,
        "backslash" => KeyCode::Backslash,
        "rightbracket" => KeyCode::RightBracket,
        "graveaccent" => KeyCode::GraveAccent,
        "world1" => KeyCode::World1,
        "world2" => KeyCode::World2,
        "escape" => KeyCode::Escape,
        "enter" => KeyCode::Enter,
        "tab" => KeyCode::Tab,
        "backspace" => KeyCode::Backspace,
        "insert" => KeyCode::Insert,
        "delete" => KeyCode::Delete,
        "right" => KeyCode::Right,
        "left" => KeyCode::Left,
        "down" => KeyCode::Down,
        "up" => KeyCode::Up,
        "pageup" => KeyCode::PageUp,
        "pagedown" => KeyCode::PageDown,
        "home" => KeyCode::Home,
        "end" => KeyCode::End,
        "capslock" => KeyCode::CapsLock,
        "scrolllock" => KeyCode::ScrollLock,
        "numlock" => KeyCode::NumLock,
        "printscreen" => KeyCode::PrintScreen,
        "pause" => KeyCode::Pause,
        "f1" => KeyCode::F1,
        "f2" => KeyCode::F2,
        "f3" => KeyCode::F3,
        "f4" => KeyCode::F4,
        "f5" => KeyCode::F5,
        "f6" => KeyCode::F6,
        "f7" => KeyCode::F7,
        "f8" => KeyCode::F8,
        "f9" => KeyCode::F9,
        "f10" => KeyCode::F10,
        "f11" => KeyCode::F11,
        "f12" => KeyCode::F12,
        "f13" => KeyCode::F13,
        "f14" => KeyCode::F14,
        "f15" => KeyCode::F15,
        "f16" => KeyCode::F16,
        "f17" => KeyCode::F17,
        "f18" => KeyCode::F18,
        "f19" => KeyCode::F19,
        "f20" => KeyCode::F20,
        "f21" => KeyCode::F21,
        "f22" => KeyCode::F22,
        "f23" => KeyCode::F23,
        "f24" => KeyCode::F24,
        "f25" => KeyCode::F25,
        "kp0" => KeyCode::Kp0,
        "kp1" => KeyCode::Kp1,
        "kp2" => KeyCode::Kp2,
        "kp3" => KeyCode::Kp3,
        "kp4" => KeyCode::Kp4,
        "kp5" => KeyCode::Kp5,
        "kp6" => KeyCode::Kp6,
        "kp7" => KeyCode::Kp7,
        "kp8" => KeyCode::Kp8,
        "kp9" => KeyCode::Kp9,
        "kpdecimal" => KeyCode::KpDecimal,
        "kpdivide" => KeyCode::KpDivide,
        "kpmultiply" => KeyCode::KpMultiply,
        "kpsubtract" => KeyCode::KpSubtract,
        "kpadd" => KeyCode::KpAdd,
        "kpenter" => KeyCode::KpEnter,
        "kpequal" => KeyCode::KpEqual,
        "leftshift" => KeyCode::LeftShift,
        "leftcontrol" => KeyCode::LeftControl,
        "leftalt" => KeyCode::LeftAlt,
        "leftsuper" => KeyCode::LeftSuper,
        "rightshift" => KeyCode::RightShift,
        "rightcontrol" => KeyCode::RightControl,
        "rightalt" => KeyCode::RightAlt,
        "rightsuper" => KeyCode::RightSuper,
        "menu" => KeyCode::Menu,
        _ => KeyCode::Unknown,
    }
}
